import os
from PIL import Image

path = 'C:/maishu/images' 
out_path = 'C:/maishu/output'
logo = Image.open('C:/maishu/logo.png')
for filename in os.listdir(path): 
    image_path = path + '/' + filename
    image = Image.open(image_path) 
    x = image.width - logo.width - 5
    y = image.height - logo.height - 5
    image.paste(logo, (x, y))
    image.save(out_path + '/' + filename) 